<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    <style type="text/css">
        body, html,#container {width: 100%;height: 100%;overflow: hidden;margin:0;font-family:"微软雅黑";}
    </style>
    <script type="text/javascript" src="http://webapi.amap.com/maps?v=1.4.4&key=0ac8778485fb1431208cd42f9484b15b"></script>
    <title>浏览器</title>
</head>
<body>
<div id="container"></div>
</body>
</html>
<script type="text/javascript">
    var res = [];
    function GetQueryString(name)
    {
        var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if(r!=null)return  unescape(r[2]); return null;
    }

    mapObj = new AMap.Map('container');
    AMap.service(["AMap.PlaceSearch"], function() {
        var placeSearch = new AMap.PlaceSearch({ //构造地点查询类
            pageSize: 5,
            pageIndex: 1,
            map: mapObj,
            panel: "panel"
        });
        var lng = GetQueryString("lng")
        var lat = GetQueryString("lat")
        var cpoint = [lng, lat]; //中心点坐标
        placeSearch.searchNearBy('', cpoint, 200, function(status, result) {
            if(status=='complete'){
                res = JSON.stringify(result.poiList.pois)
                console.log(result.poiList.pois)
            }

        });
    });

    function getResult(){
        return res
    }

</script>
